{% extends 'adminlte/base.html' %}
{% load staticfiles %}
{% if title %} 
    {% block title %}
        我相关的工单
    {% endblock %}
{% endif %}
{% block js %}
<script type="text/javascript" charset="utf8" src="{% static 'datatables/media/js/jquery.dataTables.min.js'%} "></script>
<script type="text/javascript" charset="utf8" src="{% static 'datatables/media/js/dataTables.bootstrap.min.js'%} "></script>
<script type="application/javascript">
    $(function () {
        $('#sample_3').DataTable({
            "paging": true,
            "lengthChange": true,
            "searching": true,
            "ordering": true,
            "info": true,
            "iDisplayLength": 10,
            "autoWidth": false,
        });
    });
</script>
{% endblock %}
{% block css %}
<link rel="stylesheet" type="text/css" href="{% static 'datatables/media/css/dataTables.bootstrap.min.css' %}">
{% endblock %}

{% block head_ext %}
<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        {{app_label}}
        <small>{{title|capfirst}}</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href=""><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">我相关的工单</li>
    </ol>
</section>
{{extra_content}}{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="box box-success">
                <div class="box-header with-border">
                    <div class="caption">
                        <!--<i class="fa fa-globe"></i> <h3 class="box-title">Visitors Report</h3>-->
                    </div>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                        </button>
                        <div class="btn-group">
                            <button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown">
                                <i class="fa fa-wrench"></i></button>
                            <ul class="dropdown-menu" role="menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Separated link</a></li>
                            </ul>
                        </div>
                        <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
                    </div>
                </div>
                <div class="box-body ">
                        <table class="table table-striped table-bordered table-hover dt-responsive" width="100%" id="sample_3" cellspacing="0" width="100%">
                        <thead>
                        <tr>
                            <th >流水号</th>
                            <th >标题</th>
                            <th >业务流程</th>
                            <th >当前状态</th>
                            <th >创建人</th>
                            <th >创建时间</th>
                            <th >更新时间</th>
                            <th >操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% if ticket_result_restful_list %}
                            {% for ticket in ticket_result_restful_list %}
                        <tr>
                            <td>{{ticket.sn}}</td>
                            <td>{{ticket.title}}</td>
                            <td>{{ticket.workflow.workflow_name}}</td>
                            <td>{{ticket.state.state_name}}</td>
                            <td>{{ticket.creator}}</td>
                            <td>{{ticket.gmt_created}}</td>
                            <td>{{ticket.gmt_modified}}</td>
                            <td><a href="{% url 'ticketdetailtable' ticket.id %}">详情</a></td>
                        </tr>
                            {% endfor %}
                        {% endif %}
                        </tbody>
                        </table>
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>

    </div>

{% endblock %}
